﻿using MiniFox.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MiniFox
{
    /// <summary>
    /// 启动切面，启动时执行
    /// </summary>
    [AutoRegister]
    public interface IApplicationRunner
    {
        /// <summary>
        /// 
        /// </summary>
        CancellationToken CancellationToken { get; }
        /// <summary>
        /// 启动处理过程
        /// </summary>
        /// <param name="args"></param>
        void OnProcess(params string[] args);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="args"></param>
        Task OnProcessAsync(params string[] args);
    }
    /// <summary>
    /// 
    /// </summary>
    public sealed class StartOrdinalAttribute : Attribute
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ordinal"></param>
        public StartOrdinalAttribute(int ordinal)
        {
            this.Ordinal = ordinal;
        }
        /// <summary>
        /// 
        /// </summary>
        public int Ordinal { get; }
    }
}
